package org.opens.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.opens.entity.EduCourse;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
@Component
public interface EduCourseDao extends BaseMapper<EduCourse> {

    @Select(value = "select * from edu_course where course_id = #{0}")
    EduCourse findById(Integer id);

    @Select(value = "select * from edu_course where scheduled_start_datetime >= #{0}")
    List<EduCourse> findByScheduledStartDatetime(LocalDateTime scheduledStartDatetime);

}
